﻿// -----------------------------------------------------------------------
// <copyright file="SubscriptionValidationResult.cs" company="Zen Design Corp">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Zen.BlackBerry.Subscription
{
	using System.Collections.Generic;

	/// <summary>
	/// Encapsulates the results of subscription validation including the
	/// collection of subscribers ids that do not exist, the collection of
	/// inactive subscriber ids, the collection of suspended subscriber ids,
	/// and the collection of addresses (e.g. PIN, email address) for the
	/// active subscribers. 
	/// </summary>
	/// <remarks>
	/// For each collection, any duplicates will have been removed.
	/// </remarks>
	public class SubscriptionValidationResult
	{
		private List<SubscriberPartial> _activeSubscribers;
		private List<string> _activeAddresses;
		private HashSet<string> _inactiveSubscriberIds;
		private HashSet<string> _suspendedSubscriberIds;
		private HashSet<string> _doNotExistSubscriberIds;

		/// <summary>
		/// Gets the active subscribers.
		/// </summary>
		/// <value>The active subscribers.</value>
		public IList<SubscriberPartial> ActiveSubscribers
		{
			get
			{
				if (_activeSubscribers == null)
				{
					_activeSubscribers = new List<SubscriberPartial>();
				}
				return _activeSubscribers;
			}
		}

		/// <summary>
		/// Gets the active addresses.
		/// </summary>
		/// <value>The active addresses.</value>
		public IList<string> ActiveAddresses
		{
			get
			{
				if (_activeAddresses == null)
				{
					_activeAddresses = new List<string>();
				}
				return _activeAddresses;
			}
		}

		/// <summary>
		/// Gets the inactive subscriber ids.
		/// </summary>
		/// <value>The inactive subscriber ids.</value>
		public ISet<string> InactiveSubscriberIds
		{
			get
			{
				if (_inactiveSubscriberIds == null)
				{
					_inactiveSubscriberIds = new HashSet<string>();
				}
				return _inactiveSubscriberIds;
			}
		}

		/// <summary>
		/// Gets the suspended subscriber ids.
		/// </summary>
		/// <value>The suspended subscriber ids.</value>
		public ISet<string> SuspendedSubscriberIds
		{
			get
			{
				if (_suspendedSubscriberIds == null)
				{
					_suspendedSubscriberIds = new HashSet<string>();
				}
				return _suspendedSubscriberIds;
			}
		}

		/// <summary>
		/// Gets the subscriber ids that could not be found in storage.
		/// </summary>
		/// <value>The do not exist subscriber ids.</value>
		public ISet<string> DoNotExistSubscriberIds
		{
			get
			{
				if (_doNotExistSubscriberIds == null)
				{
					_doNotExistSubscriberIds = new HashSet<string>();
				}
				return _doNotExistSubscriberIds;
			}
		}
	}
}
